package org.example.command;

/**
 * @author wangbin
 * @date 2024/4/18
 * @vesion 1.0
 */
public class RemoterController {
    Command[] onCommands;
    Command[] offCommands;
    Command undocommand;

    public RemoterController() {
        onCommands = new Command[5];
        offCommands = new Command[5];
        for(int i=0;i<5;i++){
            onCommands[i] =new NoCommand() ;
            offCommands[i] =new NoCommand() ;
        }

    }

    public void setCommand(int no,Command onCommand,Command offCommand){
        onCommands[no] =onCommand ;
        offCommands[no] =offCommand ;
    }

    public void onButtonPushed(int no){
        offCommands[no].execute();
    }
}
